home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / tkern10.zip / GNUISH\NDIR.H < prev    next >
C/C++ Source or Header  |  1990-09-19  |  2KB  |  66 lines

  1. /*  ndir.c - portable directory routines
  2.     Copyright (C) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  3.  
  4.     This program is free software; you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation; either version 1, or (at your option)
  7.     any later version.
  8.  
  9.     This program is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.     GNU General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU General Public License
  15.     along with this program; if not, write to the Free Software
  16.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.     $Header: e:/gnu/lib/RCS/ndir.h 1.0 90/09/10 23:16:20 tho Stable $
  19.  */
  20.  
  21. /* Everything non trivial in this code is taken from: @(#)msd_dir.c 1.4
  22.    87/11/06.  A public domain implementation of BSD directory routines
  23.    for MS-DOS.  Written by Michael Rendell ({uunet,utai}michael@garfield),
  24.    August 1897 */
  25.  
  26.  
  27. #define    rewinddir(dirp)    seekdir(dirp, 0L)
  28.  
  29. #define    MAXNAMLEN    12
  30.  
  31. struct direct
  32. {
  33.   ino_t d_ino;            /* a bit of a farce */
  34.   int d_reclen;            /* more farce */
  35.   int d_namlen;            /* length of d_name */
  36.   char d_name[MAXNAMLEN + 1];    /* garentee null termination */
  37. };
  38.  
  39. struct _dircontents
  40. {
  41.   char *_d_entry;
  42.   struct _dircontents *_d_next;
  43. };
  44.  
  45. typedef struct _dirdesc
  46. {
  47.   int dd_id;            /* uniquely identify each open directory */
  48.   long dd_loc;            /* where we are in directory entry is this */
  49.   struct _dircontents *dd_contents;    /* pointer to contents of dir */
  50.   struct _dircontents *dd_cp;    /* pointer to current position */
  51. } DIR;
  52.  
  53. extern void seekdir (DIR *, long);
  54. extern long telldir (DIR *);
  55. extern DIR *opendir (char *);
  56. extern void closedir (DIR *);
  57. extern struct direct *readdir (DIR *);
  58.  
  59. /* 
  60.  * Local Variables:
  61.  * mode:C
  62.  * ChangeLog:ChangeLog
  63.  * compile-command:make
  64.  * End:
  65.  */
  66.